UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dEoful4dLbRBm6sCZ8XKM2y8C/DQ92CCxyfqGCezE58='
WHERE
key_id = 'e9b810f31effe20fa29bd8081b873d8cecba7fbb3e3c05a583a8fb4ac91a96af'
AND (
token = 'dEoful4dLbRBm6sCZ8XKM2y8C/DQ92CCxyfqGCezE58='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)