UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ihye2RFuLsLJYqvLnO0eJDoS6LDlrzT7sOrIeln5U1o='
WHERE
key_id = 'f95c459dfe73c79e754aa8bfd1bb602627166bdd592c4f323726c7ab20a0089e'
AND (
token = 'Ihye2RFuLsLJYqvLnO0eJDoS6LDlrzT7sOrIeln5U1o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)