UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e3FJcpt2BBUdEmeFkEPM0jNZUOCbUpnWqo5Rpcm+spM='
WHERE
key_id = 'b8b3fdf4ec501bb3eb11f07c5847a0d805f51ed15f1d1dbde0e556d594c8adf2'
AND (
token = 'e3FJcpt2BBUdEmeFkEPM0jNZUOCbUpnWqo5Rpcm+spM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)