UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FOh+QULBEFJlKyJWmE9mK9aUtDXAu6QikXJ3ZkTeH20=' 
WHERE 
  key_id = 'd49013baa1e1e502ff781d0c2e102b6ce1ffd50795bd64115d6cfda07f79a496' 
  AND (
    token = 'FOh+QULBEFJlKyJWmE9mK9aUtDXAu6QikXJ3ZkTeH20=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033