UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9v/CHxmGib0VAHUjR26JcKhpIp+kTyTS07kPXFvTuTI=' 
WHERE 
  key_id = '0ba4806cf0707752ac79f6644629011a79d41ebe9f49700b36d522321bc188e4' 
  AND (
    token = '9v/CHxmGib0VAHUjR26JcKhpIp+kTyTS07kPXFvTuTI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021