UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jMEr9tMw2UI+on7rddLyrccf9v/4I/d53XALove5GHE=' 
WHERE 
  key_id = '9ea3c968ddae3313ad264705ca1b73dc040fa8a545174c9c3b5ccbcfa60f12ec' 
  AND (
    token = 'jMEr9tMw2UI+on7rddLyrccf9v/4I/d53XALove5GHE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057