UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c/aeYQiF+AljHWLWUPeu0aS0EQoOuNb9NYeA3Ptemd4='
WHERE
key_id = '9b90649c0282646488c521991cd97466984425b688f05afffa2551b11cf80192'
AND (
token = 'c/aeYQiF+AljHWLWUPeu0aS0EQoOuNb9NYeA3Ptemd4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)