UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eImgDbyjQAgFd97P1E6g49cn8nUZX5Uba0kokvMMDh4='
WHERE
key_id = 'c7b630e2e800c2b3083fb1e6d941188da4c6822275cca13e6ce38500cfc54a8f'
AND (
token = 'eImgDbyjQAgFd97P1E6g49cn8nUZX5Uba0kokvMMDh4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)