UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TCee2PIapD62j1VbcphcU8kG7v+qko7Sz+J3z0G3VpY='
WHERE
key_id = 'fba7292970a7a0de0944f1ec592946b4dae6cad7554d20521df9317015eeece0'
AND (
token = 'TCee2PIapD62j1VbcphcU8kG7v+qko7Sz+J3z0G3VpY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)