UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pGbQaCNwmyGf8bCIQ08kXQg3Bdvrs6BHzgBkMNNx9jc='
WHERE
key_id = '35bad931720a25467d4fdc24044f471d445b738f08948b3c99fa5dc928e94dd9'
AND (
token = 'pGbQaCNwmyGf8bCIQ08kXQg3Bdvrs6BHzgBkMNNx9jc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)