UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6u3WyeyoQrvLag72+dXp0OylLordIQcWLOW994AMYEs=' 
WHERE 
  key_id = '5648bc90d84c8adcabfe9aac8039ab2e54c20708be3b419d3023e3d8646bd9fc' 
  AND (
    token = '6u3WyeyoQrvLag72+dXp0OylLordIQcWLOW994AMYEs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024