UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ONNpBHldTPQIYJcqKM9X4rW5DbUUtVRlgse4jVyVV4Y='
WHERE
key_id = '7cb8f77169ba1fd93c3eb6bec57e6d1ed0726871f1dd020df8e75ac285c6bbaa'
AND (
token = 'ONNpBHldTPQIYJcqKM9X4rW5DbUUtVRlgse4jVyVV4Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)