UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CMWdRXxelUUCPI3R3IVVDaHCTWlr57vo1ao9o6l89ZA='
WHERE
key_id = '71ce81caa92b3232ee1e849a9fbae6c6a708d7ca06ed78a408508d6658b4c2e5'
AND (
token = 'CMWdRXxelUUCPI3R3IVVDaHCTWlr57vo1ao9o6l89ZA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)