UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X+IR/TbA1FNKNr2drpL2YQ73v885PdMZEWLwKR6w8A0='
WHERE
key_id = '4e26ce453e24fd82baddd89a3ad5cd12e7c34e9fb6ab8a00b04b8f6f4b73c78c'
AND (
token = 'X+IR/TbA1FNKNr2drpL2YQ73v885PdMZEWLwKR6w8A0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)