UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qOZ7NYC3HwaRhZl8qtKNB7LwO2uXwKyvdUbQ1tKlMfA=' 
WHERE 
  key_id = '6fa6259b9df8c62fec5f05bbf8e9cfc3794cbd67b8398ba1863644d739948dad' 
  AND (
    token = 'qOZ7NYC3HwaRhZl8qtKNB7LwO2uXwKyvdUbQ1tKlMfA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025