UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'durqhWHYrBAOwwRFGTyqbEME4RSFva5WEB73+KFu44E=' 
WHERE 
  key_id = '8df68dd62c6fde2c2e1c6ad013c7cb03c669d2e439e3dd430c5c1b2e44100ef9' 
  AND (
    token = 'durqhWHYrBAOwwRFGTyqbEME4RSFva5WEB73+KFu44E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00115