UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tQm5Lh3xZwwOYu572pI32Shg2VvDfhWUDv/hJS7NMrE='
WHERE
key_id = '6c0e658d063b9319420d5bc44f468d5ad4fa1794c3c3b64938a0ba3d63d62705'
AND (
token = 'tQm5Lh3xZwwOYu572pI32Shg2VvDfhWUDv/hJS7NMrE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)