UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R0WF47YamuVNX/V0qQ9jqa0lyujdxnpos/AA2AzXwZw=' 
WHERE 
  key_id = 'f102d26b01d2102b25e52645ac157de89b431d095faec43ca1c83888b37c4d8f' 
  AND (
    token = 'R0WF47YamuVNX/V0qQ9jqa0lyujdxnpos/AA2AzXwZw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034