UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0iZnrJSqMFFLP/SF3ZTXvIlKOXl50y8EavSIlZQ2sS8='
WHERE
key_id = '0fcb7646887e87580e7b708114e1fcf73037c152d5b20a5bd7327ec8affa6802'
AND (
token = '0iZnrJSqMFFLP/SF3ZTXvIlKOXl50y8EavSIlZQ2sS8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)