UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V3IgHek/9akmxL/rswT12fATPUy8s4YKQRl4TNSlD2Q=' 
WHERE 
  key_id = '23a49de7d3da9992b5e11d3b21fb0e49b48e3d6b2c498bca4f6f97568d261e74' 
  AND (
    token = 'V3IgHek/9akmxL/rswT12fATPUy8s4YKQRl4TNSlD2Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028