UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'saPJKTWLT8KlPkFamL+ZwIgKUPfaetBnQMNwmqTObzs='
WHERE
key_id = '00b9adb5bb333508ba865d35c4317391ab31b6b9a8f08c3ae05054962549c8ee'
AND (
token = 'saPJKTWLT8KlPkFamL+ZwIgKUPfaetBnQMNwmqTObzs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)