UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fJPSSz9k84AIwKYJS0/j+MagtkztiMuK+/ReAlWUzPE='
WHERE
key_id = 'd29ec5818fe0af1a5a731f1d54a6fa0a54ba1dfb9aa7b285d7a63bda4f34aa57'
AND (
token = 'fJPSSz9k84AIwKYJS0/j+MagtkztiMuK+/ReAlWUzPE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)