UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SqiVPjTbYffgMEFDsqvI54Mus8qvLyPlW3fzTHco30o='
WHERE
key_id = '28187cf371c4c2697ecf0817e35d0ab0465a45060e347c7acb438d1f252785c5'
AND (
token = 'SqiVPjTbYffgMEFDsqvI54Mus8qvLyPlW3fzTHco30o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)