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

Query time 0.00030