UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'knCU/T8maz+LxQG3bb8I/FYpPOZM3Qn5fuFi7Vb1eY0='
WHERE
key_id = '2972720dd207bc000538c582544a85297ae2ad4ca06f57e8b6ea47c82db34c2f'
AND (
token = 'knCU/T8maz+LxQG3bb8I/FYpPOZM3Qn5fuFi7Vb1eY0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)