UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GqRIDxXg1V81JoFPV9y6A63hJksvqdh5d0RP88s+Fsc=' 
WHERE 
  key_id = '46ce99a726487e0652bd076749d3c9d8fe9c650b7f80805506bc8ed2736f0fe1' 
  AND (
    token = 'GqRIDxXg1V81JoFPV9y6A63hJksvqdh5d0RP88s+Fsc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022