UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jFx47UI+I053O6cOgW2KpTNSN/oOiGQmaxvKHoVucnw=' 
WHERE 
  key_id = '1c3da69d3cd06bcd7b9da82b0805227a37886608716bad8596e46371ec4df30f' 
  AND (
    token = 'jFx47UI+I053O6cOgW2KpTNSN/oOiGQmaxvKHoVucnw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024