UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xBhi8bZioPrlQ9GNA8vmKanJGa2YcwL4V1UHfo6XRPI='
WHERE
key_id = '119092cf94721474e80f25adc8dd79197a13976fe16016bcc150b5ffc1c2ef6b'
AND (
token = 'xBhi8bZioPrlQ9GNA8vmKanJGa2YcwL4V1UHfo6XRPI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)