UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F/zy7M9CdsojS+Z0jdu0FulBXojkBcsenkVTlwohy7Q='
WHERE
key_id = 'bef206de6b8e4b45b1de81bc99c9f7c2dc6d985421707ee3a7f5972b1f374700'
AND (
token = 'F/zy7M9CdsojS+Z0jdu0FulBXojkBcsenkVTlwohy7Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)