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