UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F12RI50WPzripL4ob5EcSsKLmIv4MCU0DhuN3I/9ruk='
WHERE
key_id = '9fab3bda60aa0d9804dac3c08c2b660e6149ad1d5fc2733d689052f81878f2f8'
AND (
token = 'F12RI50WPzripL4ob5EcSsKLmIv4MCU0DhuN3I/9ruk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)