UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jUzjLuY7aGs5zdSuq26IiaqKgj4DdGTZAUfF0AixPOs=' 
WHERE 
  key_id = 'fdc2cbd7d1945ebf10cae6f66ee221080ce06342de79f777696561e03bb3088c' 
  AND (
    token = 'jUzjLuY7aGs5zdSuq26IiaqKgj4DdGTZAUfF0AixPOs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025