UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vT+C9Yn8wMnY1xm7gu4TwCtVK9sWDAD9rW8fhHGHYQo=' 
WHERE 
  key_id = '13cb13c02c66cd04b209f8b0d4a8f6f605ce5153c1730dcc05e2455c4a927276' 
  AND (
    token = 'vT+C9Yn8wMnY1xm7gu4TwCtVK9sWDAD9rW8fhHGHYQo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039