UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oTLBN073LizYoqF7n0I/Tetxk1zpJ7Sl53GIgEk+vKM=' 
WHERE 
  key_id = '08cb31cc95e2bc94e0adddb2b1259bf579881bf604a0b050f303db7fd91944e7' 
  AND (
    token = 'oTLBN073LizYoqF7n0I/Tetxk1zpJ7Sl53GIgEk+vKM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028