UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oL0IYFy4DnShCrjVTe5r8Pimyd+WlFcapfFVk/4wTB0='
WHERE
key_id = '71f6dbe253e3476c1579ff669a742913fcec218fb8c63d754da07044b06ed6cd'
AND (
token = 'oL0IYFy4DnShCrjVTe5r8Pimyd+WlFcapfFVk/4wTB0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)