UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0XrnNHzawWQ0/muMUWp/rqiDZSGVz8u+b3d8EedVL3A='
WHERE
key_id = '6873ef80a72aa0d2841c1c1dce07e4793c63947d62b163de3cf42941784b90bd'
AND (
token = '0XrnNHzawWQ0/muMUWp/rqiDZSGVz8u+b3d8EedVL3A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)