UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lxx72zf3r8yDTbdqNWfSnD95fDMVMObv+o9btaT/eAA=' 
WHERE 
  key_id = '728efd5ead1a05709f37b967b0f80e574644fe1c3bcf103396ec1b2cf3224d31' 
  AND (
    token = 'lxx72zf3r8yDTbdqNWfSnD95fDMVMObv+o9btaT/eAA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028