UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '86ZV7zQb84YKAjTLfeU/0PMC82e8pg5IaEIK0LqGrlY='
WHERE
key_id = '50ee57b61931f9d35e75962f96b6716641c29126b6b884f704990b6597031b88'
AND (
token = '86ZV7zQb84YKAjTLfeU/0PMC82e8pg5IaEIK0LqGrlY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)